<template>
  <section>
    FlvPlayer
    <div ref="video" id="flvplayer-app" style="background: #000"></div>
  </section>
</template>

<script>
import FlvPlayer from "flvplayer";

export default {
  name: "FlvPlayer",
  data() {
    return {
      flv: "",
    };
  },
  mounted() {
    this.initVideo();
  },
  methods: {
    initVideo() {
      console.log(FlvPlayer);
      console.log(this.$refs.video);
      if (FlvPlayer.isSupported()) {
        this.flv = new FlvPlayer({
          url: "https://tx.dogevideo.com/vcloud/17/v/20190424/1556036075_818c4125ec9c8cbc7a7a8a7cc1601512/1057/e51d88e79732fb952ebdbb4a57aa628a.flv?vkey=5EEDE5&tkey=1628487319e5d041fd98&auth_key=1628501719-4kB01r799awqBxwB-0-f0a5f269c884e879e63903c0bdfadee9",
          container: "#flvplayer-app",
          // decoder: "./flvplayer-decoder-baseline.js",
          decoder: './flvplayer-decoder-multiple.js',
          debug: true,
          live: true,
          autoPlay: true,
          hasAudio: true,
          width: 960,
          height: 540,
        });
      } else {
        console.warn("Your browser does not support Flvplayer.js");
      }
      // this.$nextTick(() => {
      //   this.flv.play();
      // });
    },
  },
};
</script>

<style lang="sass" scoped>
</style>